import http from "../utils/http"
import { PDA_API, FEED_API } from "../config"
//post拍号，获取相关拍号的数据，BOM,配方比，收货
export const pat = (productionline, palletNo, Inventory, id, type) => {
  return http.post(`${FEED_API}/GetStockRealDetail`, {
    UniqueId: palletNo,
    Line: productionline,
    InventoryStatus: Inventory,
    WareHouseId: id,
    BillType: type
  }
  ).then(res => res.data)
}
//拍码，post拍号，获取相关拍号的数据,数量调整/状态调整>
export const patLine = (palletNo) => {
  return http.post(`${PDA_API}/GetPatQuery`, {
    uniqueid: palletNo,
  }
  ).then(res => res.data)
}
//获取状态/数量调整，数量调整的状态数据>
export const statusAdjusts = () => {
  return http.get(`${PDA_API}/StockStatusMT`).then(res => res.data)
}

/* export const quantityAdjusts = () => {
  return http.get(`${PDA_API}/StockAdjustMT`).then(res => res.data)
} */
export const quantityAdjusts = () => {
  return http.post(`${FEED_API}/GetMoveTypeList`, {
    ItemName: "数量调整"
  }).then(res => res.data)
}

//待确认>
export const GetInStorageSure = (id, line) => {
  return http.post(`${FEED_API}/GetInStorageSure`, {
    WareHouse_Line: id,
    Line: line
  }
  ).then(res => res.data)
}

//收货确认提交>
export const confirmSubmit = (Account, Uniques, id) => {
  return http.post(`${FEED_API}/InStorageSure`, {
    UserAccount: Account,
    UniqueIds: Uniques,
    WareHouse_Line: id
  }
  ).then(res => res.data)
}

//退库出库提交>
export const backSubmit = (Account, Item) => {
  return http.post(`${FEED_API}/ReturnOutStorage`, {
    UserAccount: Account,
    Items: Item
  }).then(res => res.data)
}

//数量调整提交
export const numAdjustSubmit = (user, line, moveid, movename, houseid, housename, operatetype, status, item) => {
  return http.post(`${FEED_API}/StockAdjustOperate`, {
    UserAccount: user,
    Line: line,
    MoveTypeId: moveid,
    MoveTypeName: movename,
    WareHouseId: houseid,
    WareHouseName: housename,
    OperatorType: operatetype,
    InventoryStatus: status,
    Items: item

  }).then(res => res.data)
}

//状态调整提交
export const statusAdjustSubmit = (user, line, statusBefore, statusAfter, moveid, movename, item) => {
  return http.post(`${FEED_API}/StockStatusOperate`, {
    UserAccount: user,
    Line: line,
    InventoryStatusBefore: statusBefore,
    InventoryStatusAfter: statusAfter,
    MoveTypeId: moveid,
    MoveTypeName: movename,
    Items: item
  }).then(res => res.data)
}